home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / wd.zip / MATH.H < prev    next >
C/C++ Source or Header  |  1986-06-27  |  5KB  |  192 lines

  1. /*
  2.  * math.h
  3.  *
  4.  * constant definitions and external subroutine declarations for the math
  5.  * subroutine library.
  6.  *
  7.  * Copyright (C) Microsoft Corporation, 1984, 1985, 1986
  8.  */
  9.  
  10. /* definition of exception struct - this struct is passed to the matherr
  11.  * routine when a floating point exception is detected
  12.  */
  13.  
  14. struct exception {
  15.     int type;        /* exception type - see below */
  16.     char *name;        /* name of function where error occured */
  17.     double arg1;        /* first argument to function */
  18.     double arg2;        /* second argument (if any) to function */
  19.     double retval;        /* value to be returned by function */
  20.     } ;
  21.  
  22. /* definition of a complex struct to be used by those who use cabs and
  23.  * want type checking on their argument
  24.  */
  25.  
  26. struct complex {
  27.     double x,y;        /* real and imaginary parts */
  28.     } ;
  29.  
  30. /* Constant definitions for the exception type passed in the exception
  31.  * struct.
  32.  */
  33.  
  34. #define DOMAIN        1    /* argument domain error */
  35. #define SING        2    /* argument singularity */
  36. #define OVERFLOW    3    /* overflow range error */
  37. #define UNDERFLOW    4    /* underflow range error */
  38. #define TLOSS        5    /* total loss of precision */
  39. #define PLOSS        6    /* partial loss of precision */
  40.  
  41. #define EDOM        33
  42. #define ERANGE        34
  43.  
  44. /* definition of HUGE - a value return in case of error by a number of
  45.  * the floating point math routines
  46.  */
  47.  
  48. extern double HUGE;
  49. #define HUGE_VAL HUGE
  50.  
  51. /* function declarations for those who want strong type checking
  52.  * on arguments to library function calls
  53.  */
  54.  
  55. #ifdef LINT_ARGS    /* argument checking enabled */
  56.  
  57. #ifndef NO_EXT_KEYS    /* extended keywords are enabled */
  58. int cdecl abs(int);
  59. double cdecl acos(double);
  60. double cdecl asin(double);
  61. double cdecl atan(double);
  62. double cdecl atan2(double, double);
  63. double cdecl atof(char *);
  64. double cdecl cabs(struct complex);
  65. double cdecl ceil(double);
  66. double cdecl cos(double);
  67. double cdecl cosh(double);
  68. int cdecl dieeetomsbin(double *, double *);
  69. int cdecl dmsbintoieee(double *, double *);
  70. double cdecl exp(double);
  71. double cdecl fabs(double);
  72. int cdecl fieeetomsbin(float *, float *);
  73. double cdecl floor(double);
  74. double cdecl fmod(double, double);
  75. int cdecl fmsbintoieee(float *, float *);
  76. double cdecl frexp(double, int *);
  77. double cdecl hypot(double, double);
  78. double cdecl j0(double);
  79. double cdecl j1(double);
  80. double cdecl jn(int, double);
  81. long cdecl labs(long);
  82. double cdecl ldexp(double, int);
  83. double cdecl log(double);
  84. double cdecl log10(double);
  85. int cdecl matherr(struct exception *);
  86. double cdecl modf(double, double *);
  87. double cdecl pow(double, double);
  88. double cdecl sin(double);
  89. double cdecl sinh(double);
  90. double cdecl sqrt(double);
  91. double cdecl tan(double);
  92. double cdecl tanh(double);
  93. double cdecl y0(double);
  94. double cdecl y1(double);
  95. double cdecl yn(int, double);
  96. #else            /* extended keywords not enabled */
  97. int abs(int);
  98. double acos(double);
  99. double asin(double);
  100. double atan(double);
  101. double atan2(double, double);
  102. double atof(char *);
  103. double cabs(struct complex);
  104. double ceil(double);
  105. double cos(double);
  106. double cosh(double);
  107. int dieeetomsbin(double *, double *);
  108. int dmsbintoieee(double *, double *);
  109. double exp(double);
  110. double fabs(double);
  111. int fieeetomsbin(float *, float *);
  112. double floor(double);
  113. double fmod(double, double);
  114. int fmsbintoieee(float *, float *);
  115. double frexp(double, int *);
  116. double hypot(double, double);
  117. double j0(double);
  118. double j1(double);
  119. double jn(int, double);
  120. long labs(long);
  121. double ldexp(double, int);
  122. double log(double);
  123. double log10(double);
  124. int matherr(struct exception *);
  125. double modf(double, double *);
  126. double pow(double, double);
  127. double sin(double);
  128. double sinh(double);
  129. double sqrt(double);
  130. double tan(double);
  131. double tanh(double);
  132. double y0(double);
  133. double y1(double);
  134. double yn(int, double);
  135. #endif    /* NO_EXT_KEYS */
  136.  
  137. #else            /* argument checking not enabled */
  138.  
  139. #ifndef NO_EXT_KEYS    /* extended keywords are enabled */
  140. int cdecl abs();
  141. double cdecl acos();
  142. double cdecl asin();
  143. double cdecl atan();
  144. double cdecl atan2();
  145. double cdecl atof();
  146. double cdecl cabs();
  147. double cdecl ceil();
  148. double cdecl cos();
  149. double cdecl cosh();
  150. int cdecl dieeetomsbin();
  151. int cdecl dmsbintoieee();
  152. double cdecl exp();
  153. double cdecl fabs();
  154. int cdecl fieeetomsbin();
  155. double cdecl floor();
  156. double cdecl fmod();
  157. int cdecl fmsbintoieee();
  158. double cdecl frexp();
  159. double cdecl hypot();
  160. double cdecl j0();
  161. double cdecl j1();
  162. double cdecl jn();
  163. long cdecl labs();
  164. double cdecl ldexp();
  165. double cdecl log();
  166. double cdecl log10();
  167. int cdecl matherr();
  168. double cdecl modf();
  169. double cdecl pow();
  170. double cdecl sin();
  171. double cdecl sinh();
  172. double cdecl sqrt();
  173. double cdecl tan();
  174. double cdecl tanh();
  175. double cdecl y0();
  176. double cdecl y1();
  177. double cdecl yn();
  178. #else            /* extended keywords not enabled */
  179. double acos(), asin(), atan(), atan2();
  180. double cos(), sin(), tan();
  181. double cosh(), sinh(), tanh();
  182. double atof();
  183. double j0(), j1(), jn(), y0(), y1(), yn();
  184. double ceil(), fabs(), floor(), fmod();
  185. double exp(), log(), log10(), pow(), sqrt();
  186. double frexp(), ldexp(), modf();
  187. double hypot(), cabs();
  188. long labs();
  189. #endif    /* NO_EXT_KEYS */
  190.  
  191. #endif    /* LINT_ARGS */
  192.